load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "issyncer",
    srcs = [
        "deferfn.go",
        "loader.go",
        "mdl_check.go",
        "syncer.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/infoschema/issyncer",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/ddl/schemaver",
        "//pkg/ddl/systable",
        "//pkg/infoschema",
        "//pkg/infoschema/issyncer/mdldef",
        "//pkg/infoschema/metrics",
        "//pkg/infoschema/validatorapi",
        "//pkg/kv",
        "//pkg/meta",
        "//pkg/meta/autoid",
        "//pkg/meta/metadef",
        "//pkg/meta/model",
        "//pkg/metrics",
        "//pkg/session/sessmgr",
        "//pkg/sessionctx",
        "//pkg/sessionctx/vardef",
        "//pkg/store/helper",
        "//pkg/util",
        "//pkg/util/domainutil",
        "//pkg/util/intest",
        "//pkg/util/logutil",
        "//pkg/util/mathutil",
        "//pkg/util/sqlexec",
        "//pkg/util/syncutil",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_tikv_client_go_v2//txnkv/transaction",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "issyncer_test",
    timeout = "short",
    srcs = [
        "deferfn_test.go",
        "loader_test.go",
        "syncer_test.go",
    ],
    embed = [":issyncer"],
    flaky = True,
    shard_count = 5,
    deps = [
        "//pkg/infoschema",
        "//pkg/kv",
        "//pkg/meta",
        "//pkg/meta/metadef",
        "//pkg/meta/model",
        "//pkg/parser/ast",
        "//pkg/parser/mysql",
        "//pkg/store/mockstore",
        "@com_github_stretchr_testify//require",
    ],
)
